import { Flex } from "antd-mobile";
import React, { Component } from "react";
import MySearch from "../../compoents/MySearch";
import "./index.scss";
import MyFilterSecond from "../../compoents/MyFilterSecond";
class HouseList extends Component {
  constructor(props) {
    super(props);
    const position = JSON.parse(localStorage.getItem("cache_city_msg"));
    this.state = { position: position };
  }

  componentDidMount() {}
  state = {
    utilLight: [],
  };
  render() {
    const { position } = this.state;

    return (
      <div>
        <div className="MySearchWrapper">
          <Flex>
            <span
              onClick={() => {
                this.props.history.goBack();
              }}
              className="iconfont icon-icon_on_the_left"
            ></span>
            <MySearch
              curCityName={position.label}
              NavigationRoute={(pathName) => {
                this.props.history.push(pathName);
              }}
            ></MySearch>
          </Flex>
        </div>
        <MyFilterSecond
          positionValue={position.value}
          toHouseDetail={(HouseId) => {
            this.props.history.push("/house-detail/" + HouseId);
          }}
        ></MyFilterSecond>
      </div>
    );
  }
}
export default HouseList;
